﻿using Atha.Contracts;

namespace Atha.Languages
{
	public abstract class TestExecutionContextBase
	{
		private readonly ITestRunResultBuilder _testRunResultBuilder;

		public TestExecutionContextBase(ITestRunResultBuilder testRunResultBuilder)
		{
			this._testRunResultBuilder = testRunResultBuilder;
		}

		protected void IsTrue(dynamic expressionOrValue, string testName)
		{
			var result = new EqualityTestResult(testName, expressionOrValue);

			this._testRunResultBuilder.AddResult(result);
		}
	}
}